#!/usr/bin/env python
# -*- coding:utf8 -*-

"""
@version: 
@author: lh
@license: Apache Licence 
@contact: liuhuan0672@gmail.com
@site: 
@software: PyCharm
@file: 0011.py
@time: 2016/1/21 8:45

第 0011 题： 敏感词文本文件 filtered_words.txt，里面的内容为以下内容，当用户输入敏感词语时，则打印出 Freedom，否则打印出 Human Rights。
北京
程序员
公务员
领导
牛比
牛逼
你娘
你妈
love
sex
jiangge
"""


def filter_words(words):
    file_obj = open('./static/filter_words.txt', 'r', encoding='utf-8')
    filtered_words = []
    for line in file_obj:
        filtered_words.append(line.strip('\n'))
    file_obj.close()

    filtered = False
    for filter_word in filtered_words:
        if filter_word in words:
            filtered = True
            break

    if filtered is True:
        print('Freedom')
    else:
        print('Human Rights')


if __name__ == '__main__':
    while True:
        inputs = input('Input some words:')
        filter_words(inputs)
